#!/bin/bash
#This script is set MySQL password for the frist time!
mysqlinitpasswd=`grep 'temporary password' /var/log/mysqld.log |awk '{print $11}'`
mysql -uroot -p${mysqlinitpasswd} -S /var/lib/mysql/mysql.sock -e "set global validate_password_policy=0;set global validate_password_length=1;set global validate_password_policy=0;set glob
al validate_password_length=1;set password = password('123.com');grant all privileges on *.* to 'root' @'%' identified by '123.com';flush privileges;" --connect-expired-password
